package com.huaxin.hxcloud.fragment;

import android.content.Context;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.huaxin.common.Entity.UserDTO;
import com.huaxin.hxcloud.R;

import java.util.List;

/**
 * @author songxf
 * @date 2017/10/20
 * @Desc 工作模块配置
 * Copyright HUAXIN DATA. All rights reserved.
 */
public class HxWorkConfigAdapter extends BaseQuickAdapter<UserDTO.WorkModuleArrBean, BaseViewHolder> {
    private Context mContext;

    public HxWorkConfigAdapter(Context context, @Nullable List<UserDTO.WorkModuleArrBean> data) {
        super(R.layout.item_module, data);
        this.mContext = context;
    }


    @Override
    protected void convert(BaseViewHolder helper, UserDTO.WorkModuleArrBean item) {
        ImageView mImgView = helper.getView(R.id.moduleIcon);
        Glide.with(mContext).load(item.getImgUrl()).into(mImgView);
        helper.setText(R.id.moduleName, item.getName());
    }
}
